<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // let a = 1;
        // let b = a; // 基本类型赋值，等同于复制了一个相同的数据出来

        // console.log(a, b);
        // a = 100;
        // console.log(a, b);


        // let arr1 = [10, 20];
        // let arr2 = arr1; // 引用类型赋值，赋值完成后，两个变量实际上用的还是同一条数据
        // console.log(arr1, arr2);
        // arr1[0] = 100;
        // console.log(arr1, arr2);


        // let students = [
        //     { id: '1', name: '张三', age: 20, gender: '男' },
        //     { id: '2', name: '张三', age: 20, gender: '男' },
        //     { id: '3', name: '张三', age: 20, gender: '男' },
        // ]

        // const studentItem = students.find((item) => {
        //     return item.id == '2'
        // })
        // studentItem.gender = '女';
        // console.log(students);

        // let arr = [1];

        // function foo(data) {
        //     data[0]++;
        //     console.log('data', data);
        // }

        // foo(arr);

        // console.log('arr', arr);


        // let arr1 = [];
        // let arr2 = [];
        // console.log(arr1 == arr2);
        // console.log({} == {});


        // console.log(NaN == NaN);
        // console.log([] == []);
        // console.log({} == {});


        let arr1 = [1, 2, 3];
        // let arr2 = arr1;
        // arr1 = [1, 2, 3, 4];

        const arr2 = arr1.map((item) => {
            return item;
        })

        console.log(arr1 == arr2);



    </script>
</body>

</html>